package com.itheima.mapper;

import com.itheima.pojo.Setmeal;
import com.itheima.pojo.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author YangJiaHao
 */
@Mapper
public interface SetmealMapper {

    List<Setmeal> page(@Param("name") String name, @Param("start") Integer start, @Param("pageSize") Integer pageSize);

    String selectCategoryNameByCategoryId(@Param("categoryId") String categoryId);

    Long countSetmeal(@Param("name") String name);

    Integer insertSetmeal(@Param("setmeal") Setmeal setmeal);

    Integer insertDish(@Param("newSetmealDishes") List<SetmealDish> newSetmealDishes);

    Setmeal selectSetmealById(@Param("id") String id);

    List<SetmealDish> selectDishBySetmealId(@Param("id") String id);

    Integer update(@Param("setmeal") Setmeal setmeal);

    Integer countDishBySetmealId(@Param("id") String id);

    Integer removeDishBySetmealId(@Param("id") String id);

    Integer insertSetmealDish(@Param("list") List<SetmealDish> list);

    Integer deleteSetmeal(@Param("ids") String[] ids);

    Integer deleteSetmealDish(@Param("ids") String[] ids);

    Integer updateStatusByIds(@Param("status") Integer status, @Param("setmealIds") String[] setmealIds);

    List<Setmeal> selectSetmeal(@Param("categoryId") String categoryId, @Param("status") Integer status);
}
